package com.ssmIntegration.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/*
控制层的配置类

1、controller
2、全局异常处理器
3、handlerMapping、handlerAdapter
4、静态资源处理
5、jsp视图解析器前后缀
6、json转换器
7、拦截器

 */
@Configuration
@ComponentScan({"com.ssmIntegration.controller", "com.ssmIntegration.exceptionHandler"})
@EnableWebMvc
public class WebMVCJavaConfig implements WebMvcConfigurer {

    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }

    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        registry.jsp("/WEB-INF/views", ".jsp");
    }

    public void addInterceptors(InterceptorRegistry registry) {


    }

}
